package com.ruoyi.iot.service.impl;

import com.ruoyi.iot.domain.entity.DeviceAlarmWindow;
import com.ruoyi.iot.domain.query.DeviceAlarmWindowQuery;
import com.ruoyi.iot.mapper.DeviceAlarmWindowMapper;
import com.ruoyi.iot.service.DeviceAlarmWindowService;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * 设备告警窗口服务实现
 */
@Service
public class DeviceAlarmWindowServiceImpl implements DeviceAlarmWindowService {

    private final DeviceAlarmWindowMapper deviceAlarmWindowMapper;

    public DeviceAlarmWindowServiceImpl(DeviceAlarmWindowMapper deviceAlarmWindowMapper) {
        this.deviceAlarmWindowMapper = deviceAlarmWindowMapper;
    }

    /**
     * 查询设备告警窗口列表
     *
     * @param query 查询条件
     * @return 告警窗口列表
     */
    @Override
    public List<DeviceAlarmWindow> list(DeviceAlarmWindowQuery query) {
        DeviceAlarmWindowQuery safeQuery = query == null ? new DeviceAlarmWindowQuery() : query;
        return deviceAlarmWindowMapper.selectList(safeQuery);
    }
}
